package #(modelPackageName);

import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.tx.Tx;
import #(baseModelPackageName).#(tableMeta.baseModelName);
@SuppressWarnings("serial")
public class #(tableMeta.modelName) extends #(tableMeta.baseModelName)<#(tableMeta.modelName)> {
	public static final #(tableMeta.modelName) dao = new #(tableMeta.modelName)();
	public static final String tableName = "#(tableMeta.name)";
	
	/***
	 * query by id
	 */
	public #(tableMeta.modelName) getById(String id){
		return #(tableMeta.modelName).dao.findById(id);
	}
	
	/***
	 * del
	 * @param ids
	 */
	@Before(Tx.class)
	public void deleteByIds(String ids){
    	String idarr[] = ids.split(",");
    	for(String id : idarr){
    		#(tableMeta.modelName) o = #(tableMeta.modelName).dao.getById(id);
    		o.delete();
    	}
	}
	
}
